check out
可以救回檔案很酷,想問問看原理是啥~這裡我們使用的git checkout
指令呢,如果後面是放分支的話,他會切換到你要去的分支上
git checkout 分支名稱
, 這樣會切換分支如果今天git checkout
後面放著是一份檔案的話,Git不會切換分支,他會到.git
目錄裡面複製一分到目前的工作目錄
說得更詳細一點....
git checkout 文件
git checkout 123.txt
時,他會把這個123.txt
的檔案回復到上一次的Commit的狀態若是今天,我們打的是git checkout .
,它會讓所以檔案回復到上一次Commit的狀態
當你真的了解了以後~你甚至可以再加上...
$ git checkout HEAD~2 123.txt
HEAD~2
是什麼意思嗎?!
123.txt
$ git blame index.html
e757fc37 src/index.html (Chess Kuo 2020-09-05 16:05:20 +0800 1) <!DOCTYPE html>
e757fc37 src/index.html (Chess Kuo 2020-09-05 16:05:20 +0800 2) <html>
e757fc37 src/index.html (Chess Kuo 2020-09-05 16:05:20 +0800 3) <head>
e757fc37 src/index.html (Chess Kuo 2020-09-05 16:05:20 +0800 4) <title>AR</title>
e757fc37 src/index.html (Chess Kuo 2020-09-05 16:05:20 +0800 5) <script src="https://aframe.io/releases/0.9.2/aframe.min.js"></script>
e757fc37 src/index.html (Chess Kuo 2020-09-05 16:05:20 +0800 6) <script src="https://raw.githack.com/AR-js-org/AR.js/master/aframe/build/aframe-ar.js"></script>
e757fc37 src/index.html (Chess Kuo 2020-09-05 16:05:20 +0800 7) <!-- <script src="https://cdn.jsdelivr.net/gh/donmccurdy/aframe-extras@v6.1.0/dist/aframe-extras.min.js"></script> -->
e757fc37 src/index.html (Chess Kuo 2020-09-05 16:05:20 +0800 8) <script src="js/main.js"></script>
f9629d34 src/index.html (Chess Kuo 2020-09-07 17:58:22 +0800 9) <script src="js/custom-handler.js"></script>
e757fc37 src/index.html (Chess Kuo 2020-09-05 16:05:20 +0800 10) <script src="js/gesture-detector.js"></script>
e757fc37 src/index.html (Chess Kuo 2020-09-05 16:05:20 +0800 11) <script src="js/gesture-handler.js"></script>
175753f5 src/index.html (Chess Kuo 2020-09-06 14:52:56 +0800 12) <link rel="stylesheet" type="text/css" href="css/style.css">
e757fc37 src/index.html (Chess Kuo 2020-09-05 16:05:20 +0800 13) </head>
e757fc37 src/index.html (Chess Kuo 2020-09-05 16:05:20 +0800 14) <body style="margin : 0px; overflow: hidden;">
175753f5 src/index.html (Chess Kuo 2020-09-06 14:52:56 +0800 15) <div id="arjs-loader">
175753f5 src/index.html (Chess Kuo 2020-09-06 14:52:56 +0800 16) <div>Loading, please wait...</div>
175753f5 src/index.html (Chess Kuo 2020-09-06 14:52:56 +0800 17) </div>
4332a00f src/index.html (jerry 2020-10-03 22:01:19 +0800 18) <div id = "buttons_area1">
4332a00f src/index.html (jerry 2020-10-03 22:01:19 +0800 19) <button id = "start-btn" onclick="startbtn()"></button>
4332a00f src/index.html (jerry 2020-10-03 22:01:19 +0800 20) </div>
4332a00f src/index.html (jerry 2020-10-03 22:01:19 +0800 21) <div id = "buttons_area2">
4332a00f src/index.html (jerry 2020-10-03 22:01:19 +0800 22) <button id = "close-btn" onclick="closebtn()">Back</button>
4332a00f src/index.html (jerry 2020-10-03 22:01:19 +0800 23) <button id = "show-text" onclick="showText()">
雖然這是一個可以幫你抓到是誰在亂寫code的方式......不過你通常會發現那個亂寫code的人就是你自己啊XDDD